import request from "../common/request"
/**
 * 登录
 */
export function login(data) {
	return request({
		url: '/login',
		method: "post",
		data: data
	})
}

// 获取总览数据
export function getData() {
	return request({
		url: '/super',
		method: "get",

	})
}

// 获取用户信息列表
export function getUserInfo(parmas){
	let query = {}
	if(parmas){
		query = {
		url: '/user',
		method: 'get',
		parmas: parmas
		}
	}else{
		query = {
		url: '/user',
		method: 'get',
		}
	}
	return request(query)
}

// 添加用户
export function addUser(parmas){
	return request({
		url: '/user/create',
		method: 'get',
		parmas: parmas
	})
}

// 删除用户
export function deleteUser(id){
	return request({
		url: '/user/'+id,
		method: 'delete'
	})
}

// 获取用户信息
export function getUser(id){
	return request({
		url: '/user/'+id,
		method: 'get'
	})
}

// 更新用户 
export function updateUser(id,parmas){
	return request({
		url: '/user/' + id,
		method: 'put',
		parmas: parmas
	})
}
